package com.clz.hyperit.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;

import com.clz.hyperit.util.IdAnnotationin;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "answer", catalog = "hyperit")
public class Answer {
	@IdAnnotationin
	private Integer id;
	private String content;
	private Integer userDetail_id;
	private Integer question_id;
	private String createtime;
	
	public Answer() {
		
	}
	
	public Answer(Integer id, String createtime) {
		
		this.id = id;
		this.createtime = createtime;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "content")
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@Column(name = "userdetail_id")
	public Integer getUserDetail_id() {
		return userDetail_id;
	}
	public void setUserDetail_id(Integer userDetail_id) {
		this.userDetail_id = userDetail_id;
	}
	@Column(name = "question_id")
	public Integer getQuestion_id() {
		return question_id;
	}
	public void setQuestion_id(Integer question_id) {
		this.question_id = question_id;
	}
	@Generated(GenerationTime.INSERT)
	@Column(name = "createtime")
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}

	@Override
	public String toString() {
		return "Answer [id=" + id + ", content=" + content + ", userDetail_id="
				+ userDetail_id + ", question_id=" + question_id
				+ ", createtime=" + createtime + "]";
	}

}
